<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //Symbol有11个内置值，均为Symbol对象的属性

        //Symbol.hasInstance
        class Person {
            static [Symbol.hasInstance](param) {
                console.log(param, '用来检测类型的函数')
                return false
            }
        }
        let o = {}
        console.log(o instanceof Person)

        //Symbol.isConcatSpreadable
        let arr1 = [1,3,5]
        let arr2 = [2,4,6]
        console.log(arr1.concat(arr2)) //arr2的所有元素拼到arr1中
        arr2[Symbol.isConcatSpreadable] = false
        console.log(arr1.concat(arr2)) //arr2会作为一个整体拼到arr1中
    </script>
</body>
</html>